<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
</head>

<body>
    <!-- 设置挂载点 -->
    <div id="app">
        <div>num:{{ num }}</div>
        <button @click="changeNum(20)">修改num的值=20</button>
    </div>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                num: 10
            },
            methods: {
                changeNum(num) {
                    console.log(num);
                    // 获取一下data中num的值
                    // console.log( this.num );
                    // 将新的num的值赋给data中的num
                    // this.num = num;
                }
            }
        })
    </script>
</body>

</html>